<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>

    <!-- Vue2 template模板中只能有一个根元素 -->
    <!-- Vue3 template模板中能有多个根元素 -->
    <template id="my-app">
      <!-- 1.v-bind：指令的基本使用，可以用来动态绑定html属性 -->
      <img v-bind:src="imgUrl" alt="" />
      <a v-bind:href="linl">百度一下</a>

      <!-- 2.v-bind语法糖 -> : -->
      <img :src="imgUrl" alt="" />
    </template>

    <script src="../js/Vue.js"></script>
    <script>
      const app = {
        template: '#my-app',
        data() {
          return {
            imgUrl:
              'https://i2.hdslb.com/bfs/face/286056524eaa31cc36db2f7825898d012e02ea14.jpg@96w_96h_1c_1s.webp',
            linl: 'https:baidu.com'
          }
        }
      }

      Vue.createApp(app).mount('#app')
    </script>
  </body>
</html>
